package com.tool.genxml.emum;

import com.tool.genxml.entity.AttrType;

/**
 * 含有属性的数据类型
 * @author: zhoubin
 * @date: 2024/3/28
 */
public enum AttrEnum {

    ActiveCurrencyAndAmount("ActiveCurrencyAndAmount",
            new AttrType("ActiveCurrencyAndAmount", "Ccy", "Ccy")),

    ActiveOrHistoricCurrencyAndAmount("ActiveOrHistoricCurrencyAndAmount",
            new AttrType("ActiveOrHistoricCurrencyAndAmount", "Ccy", "Ccy")),

    BaseCurrencyAndAmount("BaseCurrencyAndAmount",
            new AttrType("BaseCurrencyAndAmount", "Ccy", "Ccy"))
    ;

    private String name;
    private AttrType attrType;

    AttrEnum(String name, AttrType attrType) {
        this.name = name;
        this.attrType = attrType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public AttrType getAttrType() {
        return attrType;
    }

    public void setAttrType(AttrType attrType) {
        this.attrType = attrType;
    }

    public static AttrEnum exit(String name) {
        try {
            return AttrEnum.valueOf(name);
        } catch (IllegalArgumentException e) {
            return null;
        }
    }
}
